<template>
  <div id="app">
    <router-view></router-view>
  </div>
</template>

<script>

export default {
  name: 'App',
  components: {
  },
  mounted() {
    this.getUser()
    this.getCartCount()
  },
  methods: {
    getUser(){
      this.http.get('/api/user/info').then((res={})=>{
        this.$store.dispatch('saveUserName',res.result.username);
      })
    },
    getCartCount(){
      this.http.get('/api/cart/count').then((res)=>{
        this.$store.dispatch('getCartCount',res.result.count);
      })
    }
  }
}
</script>

<style>
  @import "assets/scss/reset.scss";
  @import "assets/scss/button.scss";

</style>
